<extend name="Common@Layout:layui-admin" />
<block name="title">
    <title>文章列表</title>
</block>
<block name="style">
    <style>
        body {
            padding: 10px;
        }
        
        .page {
            text-align: center;
        }
    </style>
</block>

<block name="main">
    <div class="my-btn-box">
    	
        <span class="fl">
        	 
        </span>

        <span class="fr">
           <form class="layui-form" action="/admin/resource/images" method="get">
        	<!-- 	<span class="layui-form-label">搜索条件：</span>-->

		        <div class="layui-input-inline" style="width:100px;">
		            <php>
		                $types = array(  'title' => '图片名称' , 'key' => 'key', 'uid' => '用户ID' ,'id'=>'ID');
		            </php>
		            <select name="search_type" lay-verify="required">
                        <foreach name="types" item="vo" key="k">
                        <option value="{$k}" <if condition="$_GET['search_type'] eq $k ">selected</if>>{$vo}</option>
                        </foreach>
                    </select>
		        </div>
		        <div class="layui-input-inline" style="width:250px;">
		            <input type="text" name="search_keyword" value="{$_GET['search_keyword']}" autocomplete="off" placeholder="输入关键字搜索" class="layui-input">
		        </div>
	        <button class="layui-btn mgl-20">查询</button>
	        </form>
			<?php

	            $conditionStr = "";
	            $strToRed = ""; 
	            $condition = array();
	            if($_GET['search_type'] && $_GET['search_keyword']){ 
	                $condition[$_GET['search_type']] = $_GET['search_keyword'] ;
	                $strToRed = 'param-'.$_GET['search_type'].":".$_GET['search_keyword'];
	
	            }
	            $conditionStr = "condition=".condition_to_str($condition); 
	
	            $dataUrl = '/admin/resource/get_images';
	        ?>
        </span>

    </div>

    <form class="delform" method="post">
        <div class="layui-form datashow" data-url="{$dataUrl}" data-to-red="{$strToRed}" data-condition="{$conditionStr}" data-p="1" data-row="10">
            <table class="layui-table">
                <colgroup>
                    <col>
                    <col>
                    <col>
                    <col>
                    <col>
                    <col>
                    <col>
                    <col>
                </colgroup>
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>用户ID</th>
                        <th>图片名称</th>
                        <th>大小</th>
                        <th>预览图</th>
                        <th>key</th>
                        <th>创建时间</th>
                    </tr>
                </thead>
                <tbody class="data"></tbody>
            </table>
            <div class="page"></div>
            <script class="data-tpl" type="text/html">
                {{# layui.each(d, function(index, item){ }}
                <tr>
     
                    <td class="param-id">{{item.id}}</td>
                    <td class="param-uid">{{item.uid}}</td>
                    <td class="param-title">{{item.title}}</td>
                    <td class="paran-size">{{item.size}}</td>
                    <td class="param-fengmian"><img src="{{item.url}}" height="70px" width="70"></td>
                    <td class="param-key"> {{item.key}}</td>
                    <td>{{item.create_time }}</td>

                </tr>
                {{# }); }} {{# if(d.length === 0){ }} --- No Data --- {{# } }}
            </script>
        </div>
    </form>
</block>

<block name="script">
    <script>
    </script>
</block>